package com.bp.ice.controller;

import com.bp.ice.common.vo.JsonResult;
import com.bp.ice.common.vo.PageObject;
import com.bp.ice.entity.SysUser;
import com.bp.ice.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class SysUserController {
    @Autowired
    private SysUserService sysUserService;
    /**
     * 修改页码值
     */
//    public JsonResult doValidById(Integer pageCount){
//        sysUserService.findPages
//        return null
//    }
    /**
     * 修改状态
     */
    @RequestMapping("doValidById")
    public JsonResult doValidById(
            Integer id,Integer valid) {
        sysUserService.validById(id, valid);
        return null;
    }
    /**
     * 删除信息
     */
    @RequestMapping("doDeleteObjects")
    public JsonResult doDeleteObjects(Integer...ids){
        sysUserService.deleteObjects(ids);
        return null;
    }
    /**
     * 初始化界面
     * @param username
     * @param pageCurrent
     * @return
     */
    @RequestMapping("/doFindPageObjects")
    public JsonResult doFindPageObjects(String username,Integer pageCurrent){
        JsonResult pageObject = sysUserService.findPageObjects(username, pageCurrent);
        return pageObject;
    }
}
